/**
 * 
 */
package com.viettel.core.entities.cms;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.ForeignKey;

/**
 *  TABLE PHUONG
 *  @author: ToanTM1
 *  @version: 2.1
 *  @since: 2.1
 */
@Entity
@Table(name = "WARD")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SequenceGenerator(name = "SEQ_STORE", sequenceName = "WARD_SEQ", allocationSize = 1)
public class Ward implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = -2427042868563389323L;

    /** The id. */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_STORE")
    @Column(name = "ID")
//    @Index(name="WARD_ID_PK")
    private Integer id;
    
    /**
     * TEN PHUONG
     */
    @Basic
    @Column(name = "NAME")
    private String name;
    
    /**
     * QUAN/HUYEN
     */
    @ManyToOne(targetEntity = District.class)
    @JoinColumn(name = "DISTRICT_ID", referencedColumnName = "id")
    @ForeignKey(name = "WARD_DISTRICT_FK")
    private District district;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public District getDistrict() {
		return district;
	}

	public void setDistrict(District district) {
		this.district = district;
	}
}
